export interface PreviewField {
  columnName: string;
  fieldName: string;
  fieldClass: string;
  fieldComment?: string;
}

export interface ClassInfo {
  tableName?: string;
  originTableName?: string;
  className?: string;
  classComment?: string;
  fieldList?: PreviewField[];
}

export interface ScaffoldFile {
  templateId: string;
  path: string;
  content: string;
}

export interface ScaffoldZipResult {
  zipFileName: string;
  downloadUrl: string;
  workspace?: string;
}

export interface ScaffoldHistoryRecord {
  id: string;
  moduleName: string;
  basePackage: string;
  moduleBasePath?: string;
  databaseType: string;
  enableBlockchain: boolean;
  generateType: string;
  createdAt: string;
  zipFileName?: string;
  downloadUrl?: string;
  requestIp?: string;
}

export interface TemplateCategory {
  id: string;
  name?: string;
  description?: string;
  templates?: TemplateSummary[];
}

export interface TemplateSummary {
  id: string;
  templatePath: string;
  output: string;
  description?: string;
}

export interface ScaffoldOptionsPayload {
  author?: string;
  moduleDescription?: string;
  apiPrefix?: string;
  enableBlockchain?: boolean;
  frontendFramework?: 'REACT' | 'VUE';
  databaseType?: 'H2' | 'MYSQL';
  databaseHost?: string;
  databasePort?: number;
  databaseName?: string;
  databaseUsername?: string;
  databasePassword?: string;
  databaseUrl?: string;
  databaseDriverClassName?: string;
  chainFields?: ChainField[];
}

export interface ChainField {
  columnName: string;
  solidityType: string;
  indexed?: boolean;
}

export interface ScaffoldPayload {
  basePackage: string;
  moduleName: string;
  moduleBasePath: string;
  createTableSql: string;
  scaffoldOptions: ScaffoldOptionsPayload;
  sqlParseOptions: Record<string, unknown>;
}

